package com.szh.zx.jvm.chapter11;

/**
 * -Xmx20m -XX:MaxDirectMemorySize=10m
 * @author shkstart  shkstart@126.com
 * @create 2020  0:36
 */
public class MaxDirectMemorySizeTest {
    private static final long _1MB = 1024 * 1024;

    public static void main(String[] args) throws IllegalAccessException {
        // Field unsafeField = Unsafe.class.getDeclaredFields()[0];
        // unsafeField.setAccessible(true);
        // Unsafe unsafe = (Unsafe)unsafeField.get(null);
        // while(true){
        //     unsafe.allocateMemory(_1MB);
        // }

    }
}
